Note: This tutorial assumes that you have completed the previous tutorials: Download and install VirtualPlume.
(!) Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

Using VirtualPlume with virtual_nose

Description: This tutorial teaches how to use virtual_nose with VirtualPlume to simulate a virtual nose.

Keywords: VirtualPlume, Nose

Tutorial Level: BEGINNER

Download virtual_nose

1. Open a terminal window and cd into a directory that is on your ROS_PACKAGE_PATH. Checkout virtual_nose using svn:

svn co http://isr-uc-ros-pkg.googlecode.com/svn/trunk/unstable/odor_tools

3. Now rosmake the virtual_nose package. It's assumed that you did the previous tutorial, so you have virtualplume and lse_messages installed.

rosmake virtual_nose

Running VirtualPlume and virtual_nose

Let's start by changing directory into the virtual_nose package and then into the example directory.

roscd virtual_nose
cd example

Simulating a robot on stage

Before you can run virtualplume or virtual_nose you need to have a robot. In this tutorial you will use a simulated robot on stage, however you can also run a simulated plume on a real robot, avoiding the hassle of releasing chemicals all over your lab when experimenting with odor related algorithms!

Start a roscore and open a new terminal window to run stage. Running stage and the navigation stack is out of the scope of this tutorial. For more information on that please refer to the stage and navigation tutorials.

rosrun stage stageros roomba.world

You should now see a small arena with a Roomba robot on stage. roomba_on_stage.png

Now that you have a robot you should run the navigation stack to allow the robot to move autonomously. Furthermore VirtualPlume requires a global frame_id on which to publish the plume, since the default frame is /map we'll be using map_server to give us a map. While we're at it we will use move_base for navigation and amcl for localization. Open a new terminal window and run the following command:

roslaunch move_base.launch

VirtualPlume and virtual_nose

VirtualPlume and virtual_nose are all that is missing. VirtualPlume will provide you with a simulated chemical plume while virtual_nose will mimic a chemical sensor. Let's take a look at the virtualplume.launch file:

<launch>
        <rosparam file="$(find virtualplume)/settings/gaussian_settings.yaml" command="load" />
                <node pkg="virtualplume" type="virtualplume" name="virtualplume" />
                
                <node pkg="virtual_nose" type="virtual_nose_node" name="virtual_nose_node" />
</launch>

Notice that before virtualplume is started a yaml file is loaded into the parameter server, containing the necessary parameters to generate a gaussian plume. If no plume type is defined virtualplume will give a fatal error upon startup.

After loading the gaussian parameters virtualplume is started followed by virtual_nose.

Viewing the result

All you need now is rviz to see the plume! Open another terminal window and run rviz:

rosrun rviz rviz

From the menu select File -> Open Config, or press Ctrl+O. Find your way into virtual_nose/example and chose the example.vcg file. You should now be able to see something similar to the picture below. roomba_rviz.png

All the navigation related elements are already present. However you need to add the plume. Press the Add button and select Markers. On the marker topic select virtualplume -> virtualplume_markers. You should now see something similar to the picture below. plume_rviz.png

If you run a rostopic list command you will notice a /nose topic. This is where virtual_nose is publishing the lse_sensor_msgs/Nostril messages. Open a rxplot window with the virtual_nose readings:

rxplot /nose/reading

Now send the robot somewhere on the arena (using the 2D Nav Goal button in rviz) so that it will cross the plume and watch as the plot varies.

Congratulations! You now know how to generate simulated plumes in ROS and use them with your robot!

Keep in mind that VirtualPlume provides Gaussian and Meandering plumes as a quick and easy way to get started. These will not take obstacles into account, neither do they provide realistic chemical plume simulations. For that you should use CFD software such as ANSYS Fluent. VirtualPlume accepts Fluent log files and plays them back in ROS. You can also use a PSLog file containing data from your choice of CFD software, your own plume generation algorithms or even from a recorded plume using a chemical sensor network.

Wiki: virtualplume/Tutorials/Using VirtualPlume with virtual_nose (last edited 2013-04-16 14:07:26 by Gonçalo Cabrita)